import React, {useState, useEffect} from 'react'

export default () => {
    const [name, setName] = useState('jason')
    useEffect(() => {
        console.log('udpated')
        return () => {
            console.log('unbind')
        }
    },[])// 不传递[] 则 不区分didUpdate和didMount

    return <>
        <p>my name is: {name}</p>
        <input type="text"
               value={name}
               onChange={e => setName(e.target.value)}
        />
    </>
}